﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using SharedGenomics.Workbench.Core;

namespace SharedGenomics.Workbench.Views.WindowsForms
{
    public class WindowsFormsViewFactory : ViewFactory<Control>
    {
        public override IViewDialog CreateDialog(IPresenter presenter)
        {
            IView view = this.CreateView(presenter);
            return new ViewDialog(presenter, view);
        }

        protected override void SetNestedView(IView nestedView, Control parent)
        {
            Control nestedControl = (Control)nestedView;

            parent.Controls.Clear();
            parent.Controls.Add(nestedControl);
            nestedControl.Dock = DockStyle.Fill;
        }
    }
}
